<html>
   <head>
      <link rel="stylesheet" type="text/css" href="style.css" />
   </head>
   <body onload="">
<h2 class="comptitle">Simple Module <i>Flood</i></h2>
<b>Package:</b> org.mixim.modules.netw<br/><b>File: <a href="modules-netw-Flood.ned.html">modules/netw/Flood.ned</a></b><br/><p><a href="../doxy/a00028.html" target="mainframe"><b>C++ definition</b></a></p>

<p>A simple flooding protocol for network-level broadcast.</p>
<p>This implementation uses plain flooding, i.e. it "remembers"
(stores) already broadcasted messages in a list and does not
rebroadcast them again, if it gets another copy of that message.</p>
<p>The maximum number of entries for that list can be defined in the
.ini file (@ref bcMaxEntries) as well as the time after which an entry
is deleted (@ref bcDelTime).</p>
<p>If you prefere a memory-less version you should set to false the 
&lt;verbatim&gt;plainFlooding&lt;/verbatim&gt; bool parameter.</p>
<p><b>Author:</b> Daniel Willkomm</p>
<p>ported to Mixim 2.0 by Theodoros Kapourniotis</p>
<img src="org.mixim.modules.netw.Flood-type.png" ismap="yes" usemap="#type-diagram"/><map name="type-diagram">
<area shape="rect" href="org.mixim.modules.netw.Flood.html" title="Flood" alt="Flood" coords="0,0,79,40">
</map>
<h3 class="subtitle">Usage diagram:</h3>
<p>The following diagram shows usage relationships between types.
Unresolved types are missing from the diagram. Click <a href="full-ned-usage-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.netw.Flood-usage.png" ismap="yes" usemap="#usage-diagram"/><map name="usage-diagram"><area shape="rect" id="node1" href="org.mixim.modules.netw.Flood.html" title="Simple Module Flood" alt="" coords="5,6,77,34">
</map>
<h3 class="subtitle">Inheritance diagram:</h3>
<p>The following diagram shows inheritance relationships for this type.
Unresolved types are missing from the diagram. Click <a href="full-ned-inheritance-diagram.html">here</a> to see the full picture.</p>
<img src="org.mixim.modules.netw.Flood-inheritance.png" ismap="yes" usemap="#inheritance-diagram"/><map name="inheritance-diagram"><area shape="rect" id="node1" href="org.mixim.modules.netw.Flood.html" title="Simple Module Flood" alt="" coords="27,83,99,111">
<area shape="rect" id="node2" href="org.mixim.base.modules.BaseNetwLayer.html" title="Simple Module BaseNetwLayer" alt="" coords="5,6,120,34">
</map>
<h3 class="subtitle">Extends:</h3>
<table>
<tr>
   <td>
      <a href="org.mixim.base.modules.BaseNetwLayer.html">BaseNetwLayer</a>
      <i> (simple&nbsp;module)</i>
   </td>
   <td>

<p>Base module for every network layer module</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Parameters:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Default value</th>
      <th>Description</th>
   </tr>
<tr class="inherited">
   <td width="150">notAffectedByHostState</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">false</td>
   <td>
   </td>
</tr>
<tr class="inherited">
   <td width="150">coreDebug</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120"></td>
   <td>
<p>debug switch for core framework</p>
   </td>
</tr>
<tr class="inherited">
   <td width="150">stats</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120"></td>
   <td>
<p>stats switch</p>
   </td>
</tr>
<tr class="inherited">
   <td width="150">headerLength</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120"></td>
   <td>
<p>length of the network packet header (in bits)</p>
   </td>
</tr>
<tr class="local">
   <td width="150">plainFlooding</td>
   <td width="100">
      <i>bool</i>
   </td>
   <td width="120">true</td>
   <td>
<p>bool debug = default(false); // debug switch
       double headerLength; // length of the network header</p>
   </td>
</tr>
<tr class="local">
   <td width="150">bcMaxEntries</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">100</td>
   <td>
<p>Max number of entries in the list of already broadcasted messages</p>
   </td>
</tr>
<tr class="local">
   <td width="150">bcDelTime</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">100 s</td>
   <td>
<p>Time after which an entry for an already broadcasted msg can be deleted</p>
   </td>
</tr>
<tr class="local">
   <td width="150">defaultTtl</td>
   <td width="100">
      <i>double</i>
   </td>
   <td width="120">10</td>
   <td>
<p>Default time-to-live (ttl) used for this module expressed in  number of hops.</p>
   </td>
</tr>
</table>
<h3 class="subtitle">Properties:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Value</th>
      <th>Description</th>
   </tr>
<tr>
   <td width="150">class</td>
   <td width="100"><i>Flood</i></td>
   <td></td>
</tr>
<tr>
   <td width="150">display</td>
   <td width="100"><i>i=block/fork</i></td>
   <td></td>
</tr>
</table>
<h3 class="subtitle">Gates:</h3>
<table class="paramtable">
   <tr>
      <th>Name</th>
      <th>Direction</th>
      <th>Size</th>
      <th>Description</th>
   </tr>
<tr class="inherited">
   <td width="150">upperGateIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperGateOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>to uppe layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperControlIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>control from upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">upperControlOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>control to upper layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerGateIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerGateOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>to lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerControlIn</xsl:if></td>
   <td width="100"><i>input</i></td>
   <td width="50"></td>   <td>
<p>control from lower layer</p>
</td>
</tr>
<tr class="inherited">
   <td width="150">lowerControlOut</xsl:if></td>
   <td width="100"><i>output</i></td>
   <td width="50"></td>   <td>
<p>control to lower layer</p>
</td>
</tr>
</table>
<h3 class="subtitle">Source code:</h3>
<pre class="src"><span style="color: #808080; font-style: italic; ">// A simple flooding protocol for network-level broadcast.
//
// This implementation uses plain flooding, i.e. it &quot;remembers&quot;
// (stores) already broadcasted messages in a list and does not
// rebroadcast them again, if it gets another copy of that message.
//
// The maximum number of entries for that list can be defined in the
// .ini file (@ref bcMaxEntries) as well as the time after which an entry
// is deleted (@ref bcDelTime).
//
// If you prefere a memory-less version you should set to false the 
// &lt;verbatim&gt;plainFlooding&lt;/verbatim&gt; bool parameter.
//
// </span><span style="color: #000080; ">@author</span><span style="color: #808080; font-style: italic; "> Daniel Willkomm
//
// ported to Mixim 2.0 by Theodoros Kapourniotis
//
</span><span style="color: #800000; font-weight: bold; ">simple</span><span style="color: #000000; "> </span><span style="color: #000000; ">Flood</span><span style="color: #000000; "> </span><span style="color: #800000; font-weight: bold; ">extends</span><span style="color: #000000; "> </span><span style="color: #000000; ">BaseNetwLayer</span><span style="color: #000000; ">
{
    </span><span style="color: #800000; font-weight: bold; ">parameters</span><span style="color: #000000; ">:
        </span><span style="color: #808080; font-style: italic; ">//        bool debug = default(false); // debug switch
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">//        double headerLength; // length of the network header
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">bool</span><span style="color: #000000; "> </span><span style="color: #000000; ">plainFlooding</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">true</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// flag whether to use plain flooding
</span><span style="color: #000000; ">        </span><span style="color: #808080; font-style: italic; ">// Max number of entries in the list of already broadcasted messages
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">bcMaxEntries</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">100</span><span style="color: #000000; ">);
        </span><span style="color: #808080; font-style: italic; ">// Time after which an entry for an already broadcasted msg can be deleted
</span><span style="color: #000000; ">        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">bcDelTime</span><span style="color: #000000; "> </span><span style="color: #000000; font-weight: bold; ">@unit</span><span style="color: #000000; ">(</span><span style="color: #000000; ">s</span><span style="color: #000000; ">) = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">100</span><span style="color: #000000; "> </span><span style="color: #000000; ">s</span><span style="color: #000000; ">);
        </span><span style="color: #000080; font-weight: bold; ">double</span><span style="color: #000000; "> </span><span style="color: #000000; ">defaultTtl</span><span style="color: #000000; "> = </span><span style="color: #800000; font-weight: bold; ">default</span><span style="color: #000000; ">(</span><span style="color: #008000; ">10</span><span style="color: #000000; ">); </span><span style="color: #808080; font-style: italic; ">// Default time-to-live (ttl) used for this module expressed in  number of hops.
</span><span style="color: #000000; ">        </span><span style="color: #000000; font-weight: bold; ">@display</span><span style="color: #000000; ">(</span><span style="color: #008000; ">&quot;i=block/fork&quot;</span><span style="color: #000000; ">);
        </span><span style="color: #000000; font-weight: bold; ">@class</span><span style="color: #000000; ">(</span><span style="color: #000000; ">Flood</span><span style="color: #000000; ">);
}
</span></pre>
   <hr><p class="footer"><a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top"><img src="by-sa.png"></a> This documentation is released under the <a href="http://creativecommons.org/licenses/by-sa/3.0" target="_top">Creative Commons license</a></p>
   </body>
</html>
